package com.wang.thread;

import java.util.concurrent.*;

public class ThreadCallable implements Callable {
    @Override
    public String call() throws Exception {
        System.out.println("当前线程是："+Thread.currentThread().getName());
        return "callable";
    }

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService executorService = Executors.newFixedThreadPool(1);
        Future<String> future = executorService.submit(new ThreadCallable());
        executorService.shutdown();
        System.out.println(future.get());
    }
}
